package com.zlzlib.librxoknet.function;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import io.reactivex.rxjava3.functions.Function;
import okhttp3.ResponseBody;

/**
 * Created by zlz on 2019/8/15.
 */
public class BitmapFunction implements Function<ResponseBody, Bitmap> {

    @Override
    public Bitmap apply(ResponseBody s) throws Exception {
        return BitmapFactory.decodeStream(s.byteStream());
    }

}